interface ResultData<T = any> {
    code: string;
    message: string;
    data?: T;
}

export function codeSuccess(data:any = true): ResultData<typeof data> {
    return {
        code: "00000000",
        message: "success",
        data,
    };
}

export function codeFail(message = "fail"): ResultData {
    return {
        code: "01000000",
        message,
        data: false,
    };
}
